package de.stefanocke.roo.kontaktliste.web.common;

import org.apache.wicket.ajax.AjaxRequestTarget;

/**
 * This event is fired after an action is executed. It contains the action, the parameter
 * that were passed to the action and the result the action returned.
 * 
 * @author stoc
 *
 * @param <R>
 * @param <P>
 */
public class ActionEvent<R, P>{
	private IAction<R,P> action;
	private P param;
	private R result;
	private AjaxRequestTarget target;

	public ActionEvent(IAction<R,P> action, P param, R result, AjaxRequestTarget target) {
		this.action = action;
		this.param = param;
		this.result = result;
		this.target = target;
	}
	
	public IAction<R,P> getAction() {
		return action;
	}
	
	public P getParam() {
		return param;
	}
	
	public R getResult() {
		return result;
	}
	
	public AjaxRequestTarget getTarget() {
		return target;
	}
	
}